<template>
  <div>
    <div class="detail">

      <div>
        <el-button type="primary"
                   size="small"
                   icon="el-icon-arrow-left"
                   @click="goOff()">详情</el-button>
      </div>
      <el-card>
        <el-tabs v-model="activeName"
                 type="card">
          <el-tab-pane label="工作结构"
                       name="work">

          </el-tab-pane>
          <el-tab-pane label="指标体系"
                       name="indicator">
            <zbtx></zbtx>
          </el-tab-pane>
          <el-tab-pane label="人员"
                       name="personnel">
            <el-tabs>
              <el-tab-pane label="设计专业">
                <el-table :data="personnelTableData"
                          border
                          style="width: 100%">
                  <el-table-column prop="name"
                                   label="姓名">
                  </el-table-column>
                  <el-table-column prop="title"
                                   label="岗位">
                  </el-table-column>
                  <el-table-column prop="position"
                                   label="职称">
                  </el-table-column>
                </el-table>
              </el-tab-pane>
              <el-tab-pane label="维修专业"
                           lazy>
                <el-table :data="serviceTableData"
                          border
                          style="width: 100%">
                  <el-table-column prop="name"
                                   label="姓名">
                  </el-table-column>
                  <el-table-column prop="title"
                                   label="岗位">
                  </el-table-column>
                  <el-table-column prop="position"
                                   label="职称">
                  </el-table-column>
                </el-table>
              </el-tab-pane>
              <el-tab-pane label="总师"
                           lazy>
                <el-table :data="alwaysTableData"
                          border
                          style="width: 100%">
                  <el-table-column prop="name"
                                   label="姓名">
                  </el-table-column>
                  <el-table-column prop="title"
                                   label="岗位">
                  </el-table-column>
                  <el-table-column prop="position"
                                   label="职称">
                  </el-table-column>
                </el-table>
              </el-tab-pane>
            </el-tabs>
          </el-tab-pane>

          <el-tab-pane label="文档"
                       name="documentation">
            <el-tabs>
              <el-tab-pane label="指标文档">
                <el-table :data="documentsTableData"
                          border
                          style="width: 100%">
                  <el-table-column prop="name"
                                   label="名称">
                  </el-table-column>
                  <el-table-column prop="version"
                                   label="版本">
                  </el-table-column>
                  <el-table-column prop="path"
                                   label="查看">
                  </el-table-column>
                </el-table>
              </el-tab-pane>
              <el-tab-pane label="维修程序"
                           lazy>
                <el-table :data="repairServiceTableData"
                          border
                          style="width: 100%">
                  <el-table-column prop="name"
                                   label="名称">
                  </el-table-column>
                  <el-table-column prop="version"
                                   label="版本">
                  </el-table-column>
                  <el-table-column prop="path"
                                   label="查看">
                  </el-table-column>
                </el-table>
              </el-tab-pane>
              <el-tab-pane label="标准文档"
                           lazy>
                <el-table :data="standardTableData"
                          border
                          style="width: 100%">
                  <el-table-column prop="name"
                                   label="名称">
                  </el-table-column>
                  <el-table-column prop="version"
                                   label="版本">
                  </el-table-column>
                  <el-table-column prop="path"
                                   label="查看">
                  </el-table-column>
                </el-table>
              </el-tab-pane>
            </el-tabs>
          </el-tab-pane>

          <el-tab-pane label="模型"
                       name="manage">
            <el-tabs>
              <el-tab-pane label="数字样机">
                <el-table :data="dmuTableData"
                          border
                          style="width: 100%">
                  <el-table-column prop="name"
                                   label="名称">
                  </el-table-column>
                  <el-table-column prop="version"
                                   label="版本">
                  </el-table-column>
                  <el-table-column prop="path"
                                   label="查看">
                  </el-table-column>
                </el-table>
              </el-tab-pane>
              <el-tab-pane label="维修工具"
                           lazy>
                <el-table :data="serviceaidTableData"
                          border
                          style="width: 100%">
                  <el-table-column prop="name"
                                   label="名称">
                  </el-table-column>
                  <el-table-column prop="version"
                                   label="版本">
                  </el-table-column>
                  <el-table-column prop="path"
                                   label="查看">
                  </el-table-column>
                </el-table>
              </el-tab-pane>
              <el-tab-pane label="维修工装"
                           lazy>
                <el-table :data="associateTableData"
                          border
                          style="width: 100%">
                  <el-table-column prop="name"
                                   label="名称">
                  </el-table-column>
                  <el-table-column prop="version"
                                   label="版本">
                  </el-table-column>
                  <el-table-column prop="path"
                                   label="查看">
                  </el-table-column>
                </el-table>
              </el-tab-pane>
              <el-tab-pane label="耗材"
                           lazy>
                <el-table :data="getListConsumable"
                          border
                          style="width: 100%">
                  <el-table-column prop="name"
                                   label="名称">
                  </el-table-column>
                  <el-table-column prop="version"
                                   label="版本">
                  </el-table-column>
                  <el-table-column prop="path"
                                   label="查看">
                  </el-table-column>
                </el-table>
              </el-tab-pane>
            </el-tabs>
          </el-tab-pane>
        </el-tabs>

      </el-card>
    </div>
  </div>
</template>
 
<script>
import { default as apiList } from '../../apis/renyuan';
import { default as apiList1 } from '../../apis/moxing';
import { default as apiList2 } from '../../apis/wendang';
import zbtx from './view.vue';
export default {
    name: 'chakan',
    components: {
        zbtx,
    },
    data() {
        return {
            activeName: 'personnel',
            // 人员
            personnelTableData: [],
            serviceTableData: [],
            alwaysTableData: [],
            // 模型
            dmuTableData: [],
            serviceaidTableData: [],
            associateTableData: [],
            consumableTableData: [],
            // 文档
            documentsTableData: [],
            repairServiceTableData: [],
            standardTableData: [],
        };
    },
    created() {
        // 人员
        this.getListPersonnel(),
            this.getListService(),
            this.getListAlways(),
            // 模型
            this.getListDmu(),
            this.getListServiceaid(),
            this.getListAssociate(),
            this.getListConsumable();

        // 文档
        this.getListDocuments(), this.getListRepairService(), this.getListStandard();
    },
    methods: {
        ...apiList,
        ...apiList1,
        ...apiList2,
        /* 返回 */
        goOff() {
            this.$router.go(-1);
        },

        // 人员
        /** 查询列表(设计专业) */
        getListPersonnel() {
            this.searchsheji({ sort: 1, busiId: this.$route.query.id }).then(res => {
                this.personnelTableData = res.data;
            });
        },

        /** 查询列表(维修专业) */
        getListService() {
            this.searchsheji({ sort: 2, busiId: this.$route.query.id }).then(res => {
                this.serviceTableData = res.data;
            });
        },

        /** 查询列表(总师) */
        getListAlways() {
            this.searchsheji({ sort: 3, busiId: this.$route.query.id }).then(res => {
                this.alwaysTableData = res.data;
            });
        },

        // 模型
        /** 查询列表(数字样机) */
        getListDmu() {
            this.searchnumjy({ busiId: this.$route.query.id, sort: 1 }).then(res => {
                this.dmuTableData = res.data;
            });
        },

        /** 查询列表(维修工具) */
        getListServiceaid() {
            this.searchnumjy({ busiId: this.$route.query.id, sort: 2 }).then(res => {
                this.serviceaidTableData = res.data;
            });
        },

        /** 查询列表(维修工装) */
        getListAssociate() {
            // associateTableData
            this.searchnumjy({ busiId: this.$route.query.id, sort: 3 }).then(res => {
                this.associateTableData = res.data;
            });
        },

        /** 查询列表(耗材) */
        getListConsumable() {
            // getListConsumable
            this.searchnumjy({ busiId: this.$route.query.id, sort: 4 }).then(res => {
                this.getListConsumable = res.data;
            });
        },

        // 文档
        /** 查询列表(指标文档) */
        getListDocuments() {
            this.searchzbwd({ busiId: this.$route.query.id, sort: 1 }).then(res => {
                this.documentsTableData = res.data;
            });
        },

        /** 查询列表(维修程序) */
        getListRepairService() {
            this.searchzbwd({ busiId: this.$route.query.id, sort: 2 }).then(res => {
                this.repairServiceTableData = res.data;
            });
        },

        /** 查询列表(标准文档) */
        getListStandard() {
            this.searchzbwd({ busiId: this.$route.query.id, sort: 3 }).then(res => {
                this.standardTableData = res.data;
            });
        },
    },
};
</script>
 
<style lang="scss" scoped>
.detail {
    // padding: 15px;
}
.mb8 {
    padding-bottom: 5px;
}
</style>